<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>4-组件插槽</title>
		<script src="../vue@3.2.23.js"></script>
	</head>
	<body>
		<div id="app">
			<lay-out >
				<template v-slot:header>
					<div class="header">我在父组件定义的header</div>
				</template>
				<!-- v-slot可以简写为：# -->
				<template #content>
					<div class="content">我在父组件定义的content</div>
				</template>
			</lay-out>
		</div>
	</body>
</html>
<script>
	// 组件的内容传递
	// 具名插槽
	const app = Vue.createApp({
		
	})
	app.component('lay-out',{
		template:
		`
			<div>
				<slot name="header"></slot>
			</div>
			<div>
				<slot name="content"></slot>
			</div>
			<div>
				<div class="footer">我在子组件定义的footer</div>
			</div>
		`
	})
	const vm = app.mount("#app")
</script>